package com.zygh.policeasset.controller;

import com.zygh.policeasset.component.CommonResult;
import com.zygh.policeasset.pojo.AssetsStepsProcess;
import com.zygh.policeasset.service.AssetsStepsProcessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping({"/assetsstepsprocess"})
@Api(tags = {"资产审批审批流程"})
@RestController
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/controller/AssetsStepsProcessController.class */
public class AssetsStepsProcessController {
    @Autowired
    AssetsStepsProcessService assetsStepsProcessService;

    @RequestMapping(value = {"/"}, method = {RequestMethod.GET})
    @ApiOperation("获取资产审批审批流程分页列表")
    public Object findAll(@RequestParam(defaultValue = "1", value = "pageNum") int pageNum, @RequestParam(defaultValue = "10", value = "pageSize") int pageSize, @RequestParam("assetsStepsId") Integer assetsStepsId, @RequestParam("type") String type) {
        return this.assetsStepsProcessService.queryByAssetsId(pageNum, pageSize, assetsStepsId, type);
    }

    @RequestMapping(value = {"/add"}, method = {RequestMethod.POST})
    @ApiOperation("添加")
    public Object add(@RequestBody AssetsStepsProcess assetsStepsProcess) {
        if (this.assetsStepsProcessService.add(assetsStepsProcess) > 0) {
            return new CommonResult().success();
        }
        return new CommonResult().validateFailed("添加错误");
    }
}